$(function () {
  let baseUrl = "http://localhost:3000";
  let token = localStorage.getItem("token");
  $(".getArtcile").click(() => {
    let html = template("getArtcileTmpA");
    $(".right").html(html);
  });
  $(".right").on("click", "#getArtcileBtn", (e) => {
    e.preventDefault();
    let id = $("#getArtcileIpt").val();
    $.ajax({
      url: baseUrl + "/my/article/" + id,
      headers: { Authorization: token },
      success: (res) => {
        let html = template("getArtcileTmpB", res.data);
        $(".right").html(html);
      },
    });
  });
});
